﻿@model Gpsys.Web.Models.ServerModel
@{
    ViewBag.Title = "Servers";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section jsFooter{
    <script type="text/javascript" src="@Url.Content("~/Content/js/gps/server.js")"></script>
}
<div class="mws-panel grid_8 mws-collapsible">
    <div class="mws-panel-header">
        <span><i class="icon-table"></i>Servers</span>
    </div>
    <div class="mws-panel-toolbar">
        <div class="btn-toolbar">
            <div class="btn-group">
                <a href="@Url.Action("Create", "Server")" class="btn"><i class="icol-add"></i> Add</a>
            </div>
        </div>
    </div>
    <div class="mws-panel-body no-padding">
        <table class="mws-table mws-datatable">
            <thead>
                <tr>
                    <th>
                        Id
                    </th>
                    <th>
                        Code
                    </th>
                    <th>
                        Name
                    </th>
                    <th>
                        Description
                    </th>
                    <th>
                        Last Ping Activity
                    </th>
                    <th>
                        Status
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var wf in Model.Servers)
                {
                    <tr>
                        <td>@wf.Id
                        </td>
                        <td>@wf.Code
                        </td>
                        <td>@wf.Name
                        </td>
                        <td>@wf.Description
                        </td>
                        <td>@wf.LastPingActivity
                        </td>

                        <td>
                            @if ((DateTime.Now - wf.LastPingActivity.GetValueOrDefault()).TotalSeconds > 10)
                            {
                                <div>Stop</div>
                            }
                            else
                            {
                                <div>Active</div>
                                
                            }
                        </td>
                        
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
<!-- Panels End -->
